/// The given set of targets to this function is the initial set of
/// targets/profiles which are being built.
pub fn build_map<'b, 'cfg>(cx: &mut Context<'b, 'cfg>,
+ pkg: &'b Package,
targets: &[(&Target, &'b Profile)]) {
let mut ret = HashMap::new();
- let pkg = cx.get_package(cx.resolve.root());
for &(target, profile) in targets {
build(&mut ret, Kind::Target, pkg, target, profile, cx);
build(&mut ret, Kind::Host, pkg, target, profile, cx);
let _p = profile::start("preparing build directories");
try!(cx.prepare(pkg, targets));
prepare_init(&mut cx, pkg, &mut queue, &mut HashSet::new());
- custom_build::build_map(&mut cx, targets);
+ custom_build::build_map(&mut cx, pkg, targets);
}
// Build up a list of pending jobs, each of which represent compiling a
use std::io::prelude::*;
use support::{project, execs};
-use support::{COMPILING, RUNNING, DOCTEST};
+use support::{COMPILING, RUNNING, DOCTEST, FRESH};
use support::paths::CargoPathExt;
use hamcrest::{assert_that};
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
", compiling = COMPILING, running = RUNNING)));
+
+ assert_that(p.cargo("test").arg("-v").arg("-pb").arg("--lib"),
+ execs().with_status(0).with_stdout(&format!("\
+{compiling} b v0.5.0 ([..]
+{running} `rustc b[..]src[..]lib.rs [..] -L test[..]`
+{fresh} a v0.5.0 ([..]
+{running} `[..]b-[..]`
+
+running 0 tests
+
+test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
+
+", compiling = COMPILING, running = RUNNING, fresh = FRESH)));
});